
get_filename_component(PROJNAMES ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
project(${PROJNAMES})

file (GLOB SUB_PROJECTS ${CMAKE_CURRENT_SOURCE_DIR}/[^.]* )

foreach (CURPROJECT ${SUB_PROJECTS})
get_filename_component(PROJNAME ${CURPROJECT} NAME_WE)
    if (EXISTS ${CURPROJECT}/${PROJNAME}.c )
	message(${CURPROJECT}/${PROJNAME}.c)
	add_executable(${PROJNAME}
	  ${PROJNAME}/${PROJNAME}.c
	 )
	 target_link_libraries(${PROJNAME} libEGL libGLESv2)
SET_PROPERTY(TARGET ${PROJNAME} PROPERTY FOLDER "${PROJNAMES}")	 
	endif()

endforeach()